package com.tech.koufu.ui.activity.menu;

import com.tech.koufu.MyApplication;
import com.tech.koufu.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
/**
 * @ClassName: MyPageActivity
 * @Description: TODO(我的主页)  
 * @author 123
 * @date 2015年4月6日 下午6:17:25
 */
public class MyPageActivity extends Activity implements OnClickListener{
	private ImageView icHead;
	private TextView txtUserName;
	private EditText edUserIntro;
	private MyApplication myApp;
	private TextView tv_me_l1,tv_me_l2,tv_me_l3,tv_me_l4,tv_me_l5,tv_me_l6,
					 tv_me_r1,tv_me_r2,tv_me_r3,tv_me_r4,tv_me_r5,tv_me_r6;
	@Override
	protected void onCreate(Bundle savedInstanceState) { 
		super.onCreate(savedInstanceState);
		setContentView(R.layout.menu_mypage);
		myApp = (MyApplication)getApplicationContext();
		initView();
	}
	@Override
	protected void onResume() { 
		super.onResume();
	}
	private void initView(){
		findViewById(R.id.img_callback).setOnClickListener(this);
		((TextView)findViewById(R.id.tv_title)).setText(R.string.menu_mypage);
		icHead = (ImageView)findViewById(R.id.ic_user_head);
		txtUserName = (TextView)findViewById(R.id.txt_user_name);
		edUserIntro = (EditText)findViewById(R.id.ed_user_intro);
		txtUserName.setText("liyibo3");
		tv_me_l1 = (TextView)findViewById(R.id.tv_me_l1);
		tv_me_l2 = (TextView)findViewById(R.id.tv_me_l2);
		tv_me_l3 = (TextView)findViewById(R.id.tv_me_l3);
		tv_me_l4 = (TextView)findViewById(R.id.tv_me_l4);
		tv_me_l5 = (TextView)findViewById(R.id.tv_me_l5);
		tv_me_l6 = (TextView)findViewById(R.id.tv_me_l6);
		tv_me_r1 = (TextView)findViewById(R.id.tv_me_r1);
		tv_me_r2 = (TextView)findViewById(R.id.tv_me_r2);
		tv_me_r3 = (TextView)findViewById(R.id.tv_me_r3);
		tv_me_r4 = (TextView)findViewById(R.id.tv_me_r4);
		tv_me_r5 = (TextView)findViewById(R.id.tv_me_r5);
		tv_me_r6 = (TextView)findViewById(R.id.tv_me_r6);
		
		tv_me_l1.setText(myApp.mUserInfo.getAllMoney());
		tv_me_l2.setText(""+(Float.parseFloat(myApp.mUserInfo.getAllMoney()) - Float.parseFloat(myApp.mUserInfo.getCanUseMoney())));
		tv_me_l3.setText(myApp.mUserInfo.getCanUseMoney());
		tv_me_l4.setText(myApp.mUserInfo.getRyl() + "%");
		tv_me_l5.setText(myApp.mUserInfo.getYyl() + "%");
		tv_me_l6.setText(myApp.mUserInfo.getPm());
		
		tv_me_r1.setText(myApp.mUserInfo.getYll() + "%");
		tv_me_r2.setText(myApp.mUserInfo.getCgl() + "%");
		tv_me_r3.setText(""+(Float.parseFloat(myApp.mUserInfo.getAllMoney()) - Float.parseFloat(myApp.mUserInfo.getBeginMoney())));
		tv_me_r4.setText(myApp.mUserInfo.getZyl() + "%");
		tv_me_r5.setText(myApp.mUserInfo.getCw() );
		tv_me_r6.setText(myApp.mUserInfo.getPj());
		
	}
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.img_callback:
			this.finish();
			break;

		default:
			break;
		}
	}
}
